package cn.buaa.edu.cn.ffmpegservice.service.impl;

import cn.buaa.edu.cn.ffmpegservice.service.IVerifyService;
import lombok.RequiredArgsConstructor;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.stereotype.Service;
import cn.buaa.edu.cn.ffmpegservice.domain.dto.Record;

@Service
@RequiredArgsConstructor
public class VerifyServiceImpl implements IVerifyService {
    private final Record record;

    @Override
    public boolean verifyIdentity(String encryptedStr) {
        System.out.println(DigestUtils.md5Hex(record.getValidStr()));
        return encryptedStr.equals(DigestUtils.md5Hex(record.getValidStr()));
    }

}
